<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"
                template="/templates/ui.xhtml">

    <ui:define name="head">
        <style type="text/css">
            .col-label {
                width: 100px;
                text-align: right;
            }

            .col-input {
            }
        </style>
        <script type="text/javascript" language="javascript">
            document.onkeydown = function TabReplace() {
                if (event.keyCode == 13) {
                    if (event.srcElement.tagName != 'BUTTON')
                        event.keyCode = 9;
                }
            }

        </script>
    </ui:define>

    <ui:define name="content">
        <div style="margin:5px;">
            <p:growl id="msgs" showDetail="false"/>
            <h:form id="form">
                <p:panel header="【客户基本信息】">
                    <h:panelGrid columns="1" cellspacing="5" columnClasses="col-80">
                        <h:panelGrid columns="4" cellspacing="5"
                                     columnClasses="col-label,col-input,col-label,col-input">
                            <h:outputLabel value="客户号:" for="custno"/>
                            <p:inputText id="custno" size="30" disabled="true" readonly="true"
                                         value="#{custAddAction.custBase.custno}"/>
                            <h:outputLabel value="客户名称:" for="custname"/>
                            <p:inputText id="custname" size="30" disabled="true" readonly="true"
                                         value="#{custAddAction.custBase.custname}"/>
                        </h:panelGrid>
                    </h:panelGrid>
                </p:panel>
                <p:panel header="客户附加信息">
                    <p:focus />
                    <h:panelGrid columns="4" cellspacing="5"
                                 columnClasses="col-label,col-input,col-label,col-input">
                        <h:outputLabel value="经理姓名:" for="managerName"/>
                        <p:inputText id="managerName" size="30"
                                     value="#{custAddAction.custAdd.managerName}"/>
                        <h:outputLabel value="联系电话一:" for="managerPhone1"/>
                        <p:inputText id="managerPhone1" size="30"
                                     value="#{custAddAction.custAdd.managerPhone1}"/>
                        <h:outputLabel value="联系电话二:" for="managerPhone2"/>
                        <p:inputText id="managerPhone2" size="30"
                                     value="#{custAddAction.custAdd.managerPhone2}"/>

                        <h:outputLabel value="法人姓名:" for="legalPersonName"/>
                        <p:inputText id="legalPersonName" size="30"
                                     value="#{custAddAction.custAdd.legalPersonName}"/>
                        <h:outputLabel value="工贸业务联系人:" for="itManagerName"/>
                        <p:inputText id="itManagerName" size="30"
                                     value="#{custAddAction.custAdd.itManagerName}"/>
                        <h:outputLabel value="工贸业务电话:" for="itManagerPhone1"/>
                        <p:inputText id="itManagerPhone1" size="30"
                                     value="#{custAddAction.custAdd.itManagerPhone1}"/>
                        <h:outputLabel value="员工数量:" for="staffNum"/>
                        <p:inputText id="staffNum" size="30"
                                     value="#{custAddAction.custAdd.staffNum}"/>
                        <h:outputLabel value="店面数量:" for="storefrontNum"/>
                        <p:inputText id="storefrontNum" size="30"
                                     value="#{custAddAction.custAdd.storefrontNum}"/>
                        <h:outputLabel value="与工贸合作年数:" for="coopYears"/>
                        <p:inputText id="coopYears" size="30" maxlength="5"
                                     value="#{custAddAction.custAdd.coopYears}">
                            <f:convertNumber pattern="###,###"/>
                        </p:inputText>
                        <h:outputLabel value="合作起始年份:" for="coopStartdate"/>
                        <p:inputMask mask="9999" id="coopStartdate" size="30" maxlength="4"
                                     value="#{custAddAction.custAdd.coopStartdate}">
                        </p:inputMask>
                    </h:panelGrid>
                    <h:panelGrid columns="2">
                        <p:commandButton id="saveBtn" style="width:80px;margin-left:200px;" value="保存"
                                         action="#{custAddAction.onEdit}"
                                         update="msgs,form">
                        </p:commandButton>
                        <p:commandButton id="clsBtn" style="width:80px;" value="关闭" onclick="window.close();"/>
                    </h:panelGrid>
                </p:panel>

                <p:ajaxStatus style="height:18px;text-align:center">
                    <f:facet name="start">
                        <h:graphicImage value="/images/ajaxloadingbar.gif"/>
                    </f:facet>
                    <f:facet name="complete">
                        <h:outputText value=""/>
                    </f:facet>
                </p:ajaxStatus>
            </h:form>
        </div>
    </ui:define>

</ui:composition>